//
//  GestureImageView.m
//  homework_UInavigationController
//
//  Created by dllo on 16/6/14.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "GestureImageView.h"
#import "FirstViewController.h"

@implementation GestureImageView

-(instancetype)initWithImage:(UIImage *)image withFrame:(CGRect)frame
{
    self = [super initWithImage:image];
    
    if (self) {
        
        self.frame = frame;
        
        self.userInteractionEnabled = YES;
        
        [self addTap];
        
    }
    
    return self;
}

/**点击手势*/
-(void)addTap
{
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAction:)];
    
    tap.numberOfTouchesRequired = 1;
    
    tap.numberOfTapsRequired = 1;
    
    [self addGestureRecognizer:tap];
    
    [tap release];
}

-(void)tapAction:(UITapGestureRecognizer *)tap
{
    [self.delegate next:self];
}



@end
